package com.songlanyun.common.enums;

import java.util.HashMap;
import java.util.Map;

public enum KqValidFlagEnum {
    /**
     * 快钱银行卡策略---是否满足快钱业务
     */

    OK("1", "满足"),//启用
    NO("0", "不满足");//未启用

    private final String code;
    private final String desc;

    public String getCode() {
        return code;
    }

    public int getIntCode() {
        return Integer.parseInt(code);
    }

    public String getDesc() {
        return desc;
    }

    private static final Map lookup = new HashMap();

    static {
        for (KqValidFlagEnum e : KqValidFlagEnum.values()) {
            lookup.put(e.code, e);
        }
    }

    public static KqValidFlagEnum find(String code, KqValidFlagEnum defaultValue) {
        KqValidFlagEnum value = (KqValidFlagEnum) lookup.get(code);
        if (value == null) {
            return defaultValue;
        }
        return value;
    }


    KqValidFlagEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }
}
